package com.skt.casdemo.view;

import com.skt.casdemo.R;
import com.skt.casdemo.R.layout;

import android.os.Bundle;
import android.app.Activity;
import android.graphics.Rect;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.Display;
import android.view.Menu;
import android.view.Window;
import android.widget.ArrayAdapter;
import android.widget.Button;

public class ScreenTestActivity extends Activity {
	
	Button btn;
	Display display;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
        DisplayMetrics dm = new DisplayMetrics();
        getWindowManager().getDefaultDisplay().getMetrics(dm);
        
//        int screenHeight = dm.heightPixels;
//        int screenWidth = dm.widthPixels;        
        
        Log.d("resolution test", "Height Pixels : " + String.valueOf(dm.heightPixels));
        
        Log.d("resolution test", "Width Pixels : " + String.valueOf(dm.widthPixels));
        
        Log.d("resolution test", "Xdpi : " + String.valueOf(dm.xdpi));
        Log.d("resolution test", "Ydpi : " + String.valueOf(dm.ydpi));
        
        //Log.d("resolution test", "StatusBar Height= " + StatusBarHeight + " , TitleBar Height = " + TitleBarHeight);
        
        switch(getIntent().getExtras().getInt("type")){
        	case 1:
        		setContentView(R.layout.screen_test1);
        		break;
        	case 2:
        		setContentView(R.layout.screen_test2);
        		break;
        	case 3:
        		setContentView(R.layout.screen_test3);
        		btn = (Button)findViewById(R.id.button1);
//        		btn.setText("height : " + String.valueOf(btn.getMeasuredHeight()) + " / width : "  + String.valueOf(btn.getMeasuredWidth()));
//        		Log.d("resolution test", "height : " + String.valueOf(btn.getMeasuredHeight()) + " / width : "  + String.valueOf(btn.getMeasuredWidth()));
        		btn.setText("height : " + String.valueOf(btn.getLayoutParams().height) + " / width : "  + String.valueOf(btn.getLayoutParams().width));
        		Log.d("resolution test", "height : " + String.valueOf(btn.getLayoutParams().height) + " / width : "  + String.valueOf(btn.getLayoutParams().width));
        		break;
        	default:
        		setContentView(R.layout.screen_test1);
        		break;
        }
    }
}
